package com.jjyu.controller;

import com.jjyu.entity.Restaurant;
import com.jjyu.service.RestaurantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author jiajunyu
 */
@RestController
@RequestMapping("/restaurant")
public class RestaurantController {
    @Autowired
    private RestaurantService restaurantService;

    @GetMapping("/all")
    public List<Restaurant> getAllRestaurant() {
        System.out.println("getAllRestaurant");
        return restaurantService.getAllRestaurant();
    }

}

